package com.hlhj.carview.adapter

import android.support.v7.widget.RecyclerView
import android.widget.LinearLayout
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hlhj.carview.R
import com.hlhj.carview.http.Urls
import com.liaoinstan.springview.utils.DensityUtil

/**
 * Created by Never Fear   on 2018\12\21 0021.
Never More....
 */
class CarImgListAdp(private val datas:ArrayList<String>) :BaseQuickAdapter<String,BaseViewHolder>(R.layout.carimg_list_item,datas) {
    override fun convert(helper: BaseViewHolder?, item: String?) {
        val layout = helper?.itemView as LinearLayout
        val params = layout.layoutParams as RecyclerView.LayoutParams
        params.marginStart=DensityUtil.dip2px(mContext,20f)
        layout.layoutParams=params

        Glide.with(mContext).load(Urls.Img+item).into(helper?.getView(R.id.itemImg))
    }
}